<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>校园二手物品交易平台</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <script src="/static/layui/layui.js"></script>
    <script src="/static/JQuery/jquery-3.3.1.min.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">校园二手物品交易平台</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <!--<ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">控制台</a></li>
            <li class="layui-nav-item"><a href="">商品管理</a></li>
            <li class="layui-nav-item"><a href="">用户</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="">邮件管理</a></dd>
                    <dd><a href="">消息管理</a></dd>
                    <dd><a href="">授权管理</a></dd>
                </dl>
            </li>
        </ul>-->
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;" id="loginUsername">
                    loginUsername
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;" onclick="changeMain('userInfo')">基本资料</a></dd>
                    <dd><a href="javascript:;" onclick="changeMain('userPassword')">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="/system/doLogout">退了</a></li>
        </ul>
    </div>
<!----------------------------------------------------------------------->
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">用户及权限管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" onclick="changeMain('user')">用户信息</a></dd>
                        <dd><a href="javascript:;" onclick="changeMain('address')">收货地址</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">商品管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" onclick="changeMain('goods')">商品信息</a></dd>
                        <dd><a href="javascript:;" onclick="changeMain('type')">商品类型</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">交易管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" onclick="changeMain('order')">交易信息</a></dd>
                        <dd><a href="javascript:;" onclick="changeMain('state')">交易状态</a></dd>
                        <dd><a href="javascript:;" onclick="changeMain('record')">评价信息</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 10px; height: 100%">
            <iframe id="main" width="100%" src="/user" height="100%" frameborder="no"></iframe>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域
    </div>
</div>
<script>
    function changeMain(target){
        $("#main").attr("src", "/" + target);
    }


</script>
<script>

    $.ajax({
        url:"/system/getLoginUserInfo",
        type:"GET",
        async: false,
        success : function(result) {
            if(result){
                $('#loginUsername').html(result.username);
            }else{
                window.location.replace("/templates/login.html");
            }
        }
    });
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;


    });

</script>
</body>
</html>
